package com.kerrykidz.system.dao.model;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.kerrykidz.system.util.DateUtil;
import com.rdp.framework.core.model.MyBatisSuperModel;
import com.rdp.util.lang.StringUtil;

/**
 * 金蝶对接批次表，每天一条记录
 * @author huanjiang
 *
 */
public class KdeBatchEntity extends MyBatisSuperModel{
	
	//对接状态 =1 未确认 =2 未启动 =3 进行中 =4 完成
	public static final String STATUS_UNENABLE = "1"; 
	public static final String STATUS_UNSTART = "2";
	public static final String STATUS_CONDUCT = "3";
	public static final String STATUS_FINISH = "4";
	

	//对接批次编号，主键 
	private String pkKdebtId;
	
	//分店编号
	private String fkBranId;
	
	//对接状态 =1 未确认 =2 未启动 =3 进行中 =4 完成
	private String syncStatus;
	
	//确认时间
	private Date confirmTime;
	private String confirmTimeStr;
	
	//对接日期
	private Date syncDate;
	private String syncDateStr;
	
	//最近对接时间 
	private Date lastSync;
	private String lastSyncStr;
	
	//尝试次数
	private Integer trialCnt;
	
	//完成时间 
	private Date compTime;
	private String compTimeStr;
	
	//修改人
	private String modiBy;
	
	//修改时间 
	private Date modiTime;
	
	//查询开始时间 
	private Date startTime;
	
	//查询结束时间
	private Date endTime;

	//未完成次数
	private String undoCnt;
	
	//门店名
	private String branName;
	
	public String getBranName() {
		return branName;
	}

	public void setBranName(String branName) {
		this.branName = branName;
	}

	public String getUndoCnt() {
		return undoCnt;
	}

	public void setUndoCnt(String undoCnt) {
		this.undoCnt = undoCnt;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public String getPkKdebtId() {
		return pkKdebtId;
	}

	public void setPkKdebtId(String pkKdebtId) {
		this.pkKdebtId = pkKdebtId;
	}

	public String getFkBranId() {
		return fkBranId;
	}

	public void setFkBranId(String fkBranId) {
		this.fkBranId = fkBranId;
	}

	public String getSyncStatus() {
		return syncStatus;
	}

	public void setSyncStatus(String syncStatus) {
		this.syncStatus = syncStatus;
	}

	public Date getConfirmTime() {
		return confirmTime;
	}

	public void setConfirmTime(Date confirmTime) {
		this.confirmTime = confirmTime;
	}

	public Date getSyncDate() {
		return syncDate;
	}

	public void setSyncDate(Date syncDate) {
		this.syncDate = syncDate;
	}

	public Date getLastSync() {
		return lastSync;
	}

	public void setLastSync(Date lastSync) {
		this.lastSync = lastSync;
	}

	public Integer getTrialCnt() {
		return trialCnt;
	}

	public void setTrialCnt(Integer trialCnt) {
		this.trialCnt = trialCnt;
	}

	public Date getCompTime() {
		return compTime;
	}

	public void setCompTime(Date compTime) {
		this.compTime = compTime;
	}

	public String getModiBy() {
		return modiBy;
	}

	public void setModiBy(String modiBy) {
		this.modiBy = modiBy;
	}

	public Date getModiTime() {
		return modiTime;
	}

	public void setModiTime(Date modiTime) {
		this.modiTime = modiTime;
	}

	public String getConfirmTimeStr() {
		if(this.confirmTime != null){
			return DateUtil.formatDate("yyyy-MM-dd", this.confirmTime);
		}
		return null;
	}

	public void setConfirmTimeStr(String confirmTimeStr) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		try {
			this.confirmTime = sdf.parse(confirmTimeStr);
		} catch (ParseException e) {
		}
	}

	public String getSyncDateStr() {
		if(this.syncDate != null){
			return DateUtil.formatDate("yyyy-MM-dd", this.syncDate);
		}
		return null;
	}

	public void setSyncDateStr(String syncDateStr) {
		this.syncDateStr = syncDateStr;
	}

	public String getLastSyncStr() {
		if(this.lastSync != null){
			return DateUtil.formatDate("yyyy-MM-dd", this.lastSync);
		}
		return null;
	}

	public void setLastSyncStr(String lastSyncStr) {
		this.lastSyncStr = lastSyncStr;
	}

	public String getCompTimeStr() {
		if(this.compTime != null){
			return DateUtil.formatDate("yyyy-MM-dd", this.compTime);
		}
		return null;
	}

	public void setCompTimeStr(String compTimeStr) {
		this.compTimeStr = compTimeStr;
	}

	
	
}
